Conversation
This reverts commit 7959831.
TODO: add tests
Still failing though - it seems that proper clean up isn't happening for a few tests that get an actual reference to the `window` object. May need to rewrite these tests. Perhaps something to contribute upstream?
andrewiggins
commented
Aug 17, 2020
| "build": "microbundle --target node -f cjs --no-compress src/index.js src/cli.js src/appender.js", | ||
| "build": "npm run build:node && npm run build:web", | ||
| "build:node": "microbundle --target node -f cjs --no-compress src/index.js src/cli.js src/appender.js", | ||
| "build:web": "microbundle -f iife --no-compress --external none --alias jest-message-util=C:\\code\\github\\developit\\karmatic\\src\\lib\\jest\\messageUtilFake.js --define process.env.NODE_ENV=production -i src/lib/jest-globals.js -o dist/lib/jest-globals.js", |
Collaborator
Author
There was a problem hiding this comment.
I'm bundling jest-globals.js separately at build time to avoid our users having to re-bundle all the jest stuff on each run of karmatic. Probably need to move some of these deps into devDeps since they are bundled. Or maybe move them to bundledDeps?
Also need to figure out/fix how to specify aliases in microbundle so that it doesn't require absolute paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My attempt to include more Jest globals. Sharing to get early feedback though I need to take a break from this for now to focus on other things.
fakeTimers.test.js has two tests failing right now because I think some tests are improperly leaking changed globals between tests.
But I think this PR gets Jest's
fn()mocking function and fake timers API working!